<template>
	<view class="content">
		<view class="btn-row">
			<button open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 登录 </button>
		</view>
	</view>
</template>
<script>
export default {
	name: "WxLogin",
	props: {
		name: String,
	},
	data() {
		return {

		}
	},
	computed: {

	},
	methods: {
		getUserInfo(e) {
			console.log(e.detail.userInfo)
			this.Bmob.User.upInfo(e.detail.userInfo)
		}
	},
	mounted() {

	},
	components: {

	},
	onLoad() {
		this.Bmob.User.auth().then(res => {
			console.log(res)
			console.log('一键登陆成功')
		}).catch(err => {
			console.log(err)
		});
	}
}
</script>